package com.cet.test.mt04.qz3;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @program: cet-practice
 * @description:
 * @author: 陈恩涛
 * @create: 2023-05-06 21:22
 **/
public class DemoService {

    private final List<Integer> data = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

    List<Integer> getData(long offset, int limit) {
        return data
            .stream()
            .skip(offset)
            .limit(limit)
            .collect(Collectors.toList());
    }
}
